/**
 * JAVACC DEMO 1.0
 * @copy right zbxsoft company All rights reserved. 
 * @Package com.zbxsoft.portal.send.method  
 */
package com.apache.design.template;

import com.apache.design.util.GZipUtil;
import com.apache.tools.StrUtil;
import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;

import java.util.List;

/**
 * description:  格式化Long类型时间
 */
public class UpperFirstMethod implements TemplateMethodModel {

	/**
	 * TODO 简单描述该方法的实现功能（可选）.  
	 * @see TemplateMethodModel#exec(List)
	 */
	public Object exec(List arguments) throws TemplateModelException {
		String str = String.valueOf(arguments.get(0));
		if (StrUtil.isNotNull(str)) {
			if (arguments.size() > 1) {
				return GZipUtil.toLowerFirst(str);
			} else {
				return GZipUtil.toUpperFirst(str);
			}
		}
		return "";
	}

}
